package personalize;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class lookandfeel{
	// Specify the look and feel to use by defining the LOOKANDFEEL constant
	// Valid values are: null (use the default), "Metal", "System", "Motif","Nimbus",
	// and "GTK"
	public static String lookAndFeel = null;

	public static void uiFromOS(){
		String OS = System.getProperty("os.name").toLowerCase();
		if (OS.indexOf("macosx") >= 0)
			lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
		else if (OS.indexOf("windows") >= 0)
			lookAndFeel = "javax.swing.plaf.nimbus.NimbusLookAndFeel";
		//lookAndFeel = "javax.swing.plaf.synth.SynthLookAndFeel";
		//lookAndFeel = "javax.swing.plaf.basic.BasicLookAndFeel";
		//lookAndFeel = "javax.swing.plaf.multi.MultiLookAndFeel";
		//lookAndFeel = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
		//lookAndFeel = UIManager.getSystemLookAndFeelClassName();
		else if (OS.indexOf("linux") >= 0)
			lookAndFeel = "javax.swing.plaf.nimbus.NimbusLookAndFeel";//"com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
		else
			lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
		try {
			UIManager.setLookAndFeel(lookAndFeel);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}